<?php


class Simpleshop_Model_DbTable_Article_Row extends WSB_Db_Row
{

	public function init()
	{
		$this->_formConfigPath = WSB_XTENSION_PATH . 'simpleshop/models/DbTable/Article/form.config';
	}

	/**
	 * @return string
	 */
	public function getShorttext()
	{
		return $this->shorttext;
	}

	/**
	 * @return string
	 */
	public function getLongtext()
	{
		return $this->longtext;
	}

	/**
	 * @return float
	 */
	public function getPrice()
	{
		return floatval($this->price);
	}

	/**
	 * @return string
	 */
	public function getListImage()
	{
		if(empty($this->images)) {
			return null;
		}
		$images = WSB_Div::csvToArray($this->images, ',');
		if(empty($images)) {
			return null;
		}
		return reset($images);
	}

	/**
	 * @return array
	 */
	public function getDetailImages()
	{
		if(empty($this->images)) {
			return array();
		}
		$images = WSB_Div::csvToArray($this->images, ',');
		if(empty($images)) {
			return array();
		}
		return $images;
	}

}